package com.shopping.dao;

import java.util.List;
import java.util.Map;

import com.shopping.bean.Goods;

public interface GoodsDao {

	/**
	 * 通过关键字查找商品
	 * @param keyeord
	 * @return
	 */
	List<Goods> selectGoodsByKeyword(String keyword,int pageNum,int pageSize);
	
	/**
	 * 查询总条数
	 * @param keyword
	 * @return
	 */
	int selectTotalRows(String keyword);
	
	/**
	 * 通过商品描述获取商品信息
	 * @param gType
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
	List<Goods> selectGoods(String gType,int pageNum,int pageSize);
	
	/**
	 * @param name
	 * @return
	 * 通过名字来查找
	 */
	Map<String,Object> selectByName(String name);
	
	int insertGoodsOnShopCar(int userId,Goods goods,int goodsNum);
	
	int insertGoods(Goods goods);
	
	int selectGoodsTotalRows();
	
	Goods selectGoodsById(int goodsId);
	
	List<Goods> selectGoods(Map<String,String[]> condition);
	
	int selectTotalRows(Map<String,String[]> condition);

	int deleteGoodsById(int goodsId);
	
	int updateGoods(Goods newGoods,Goods oldGoods);
	
}
